<template>
	<view class="content">
		<view class="colmun" v-for="(item,index) in list" :key="index">
			<view class="title">{{item.message}}</view>
			<view class="time">{{item.createtime}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				page: 1,
				last_page: 1
			}
		},
		onReachBottom() {
			if(this.last_page - this.page >= 0){
				this.loadData();
				this.page ++
			}
		},
		onLoad() {
			this.loadData()
		},
		methods: {
			loadData(){
				this.$http.post('/api/userinfo/msg').then(res => {
					this.last_page = res.data.data.last_page;
					if(this.page == 1){
						this.list = res.data.data.data;
					}else{
						this.list = this.list.concat(res.data.data.data)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content{
	background-color: #F8F8F8;
	min-height: 100vh;
	padding: 30rpx;
	box-sizing: border-box;
}
.colmun{
	width:690rpx;
	// height: 150rpx;
	padding: 24rpx 30rpx;
  margin-bottom: 20rpx;
	box-sizing: border-box;
	background:rgba(255,255,255,1);
	border-radius:10px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
	.title{
		font-size:16px;
		font-family:PingFang SC;
		font-weight:bold;
		color:rgba(51,51,51,1);
	}
	.time{
		font-size:13px;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(102,102,102,1);
	}
}
</style>
